﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Einstein.Utility
{
    public class BoxManager
    {
        public static void ShowWarning(string txt)
        {
            MessageBox.Show(txt, GlobalContents.AppName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        public static void ShowInformation(string txt)
        {
            MessageBox.Show(txt, GlobalContents.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static void ShowSuccess()
        {
            ShowInformation("保存成功!");
        }

        public static void ShowDeleteSuccess()
        {
            ShowInformation("删除成功!");
        }
        public static void ShowDeleteFail()
        {
            ShowError("删除失败!");
        }

        public static void ShowError(string txt)
        {
            MessageBox.Show(txt, GlobalContents.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void ShowFail()
        {
            ShowError("保存失败!");
        }

        public static DialogResult ShowAsk(string txt)
        {
            return MessageBox.Show(txt, GlobalContents.AppName, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
        }

        public static DialogResult ShowDeleteAsk()
        {
            return MessageBox.Show("您确定要删除指定的数据吗？", GlobalContents.AppName, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
        }
    }
}
